 #include <iostream>
 using namespace std;
 
    class Complex
    {            
       private:
            int x, y;
       public:
         Complex(int _x=0, int _y=0){
            x = _x;
            y = _y;
         }
         void ShowComplex();
         friend Complex operator-(const Complex& p1, const Complex& p2);         
     };
     
     void Complex::ShowComplex(){
        if(y > 0)
            cout<<x<<"+" <<y<<"i"<<endl;
        else if(y <0)
            cout<<x<<y<<"i"<<endl;
        else if(y == 0)
            cout<<x<<endl;
     } 
  // Global Operator Function
    Complex operator-(const Complex& p1, const Complex& p2){
        Complex temp;
        temp.x = p1.x - p2.x;
        temp.y = p1.y - p2.y;
        return temp;
       
    }

 void main(){        
  Complex x(1,2), y(2,4), z;
  cout<<"\n -- Minus of two Complex Object -- \n";
  z = x - y;
  x.ShowComplex();  
  y.ShowComplex();
  z.ShowComplex();
 }